package analyzer;

import java.util.LinkedList;

import pokemon.*;

public class SimpleBrainAnalyzer extends OrganAnalyzer {

	@Override
	public Consultation work(Pokemon pokemon) {
		LinkedList<Byte> characteristics = new LinkedList<Byte>();
		for (int i = 0; i < pokemon.getPockemonOrg().size(); i++) {
			
			if (pokemon.getPockemonOrg().get(i).getClass().getSimpleName()
					.equals("Brain")) {

				characteristics.add(((Brain) (pokemon.getPockemonOrg().get(i)))
						.getEnergy());
				characteristics.add(((Brain) (pokemon.getPockemonOrg().get(i)))
						.getMemory());
				characteristics.add(((Brain) (pokemon.getPockemonOrg().get(i)))
						.getOxygenation());
			}
		}
		String resultString = countAdvice(characteristics);
		if (resultString == null) {
			resultString = "Нема мозку((";
		}
		return new Consultation(resultString);
	}

}
